Mobile computing devices, such as smartphones and tablets, can be equipped with a variety of hardware components, such as multi-core processors, large-capacity DRAM, and/or and flash storage devices. Input/output (I/O) performance of mobile computing devices, such as reading from and/or writing to non-volatiles memory, can be a significant factors in the overall performance of applications that are running on mobile computing device. To maintain data consistency and integrity, mobile computing devices can use embedded databases, such as SQLite, Shared Preference key-value stores, and/or the file system API to save persistent data to local non-volatile memory, such as flash memory and/or hard disk. Such embedded databases can operate by storing a small amount of structured data in volatile memory and can rely upon the non-volatile memory (e.g., file systems) to store larger, unstructured data objects, such as images and documents. To ensure updates are performed in a persistent fashion, which includes atomicity, consistency, and durability, such embedded databases can employ journaling and/or file-level double-write.
For example, the SQLite database uses rollback journal or write-ahead log to track the changes to the database table files. In another example, the Shared Preference (stored as an xml file in the file system) and some applications that store important data in files use file-level double-write to avoid data loss when modifying important files. In such an implementation, the whole file, instead of the modified parts, can be written to a temporary file that will subsequently be renamed. In a further example, the underlying EXT4 file system uses metadata journaling to ensure data consistency. This can add significant overhead to and thus substantially degrade system performance by increasing I/O traffic with extra data written to the flash storage. For example, SQLite can cause mobile computing devices to perform Journaling of Journal (JOJ), which refers to the double-journaling phenomenon in which the file system is journaling the database journal activities. Additionally, double writing of data can further shortens the lifetime of non-volatile memory, such as flash storage devices, in mobile computing devices.